﻿@model QDT.Web.Models.IsLoginModel
@{
    var user = QDTContext.Current.User;
}
@if (Model != null && Model.IsLogin)
{
    <a href="@Url.Action("Index", "User")">@Model.UserName</a>
    <a href="@Url.Action("Index", "User")">个人中心</a>
    <a onclick="window.external.AddFavorite('http://www.zxidai.com','众禧贷')" href="javascript:;">
        收藏</a>
@*    <a href="@Url.Action("Help", "Home")" >常见问题</a>*@
    <a href="@Url.Action("LogOut", "Account")" class="last">退出</a>
}
else
{
    <a href="@Url.Action("Register", "Account")" class="topreg">免费注册</a>
    <a href="@Url.Action("LogIn", "Account")" >立即登录</a>
    <a href="javascript:;" onclick="javascript:addfavor('http://www.zxidai.com','众禧贷');">
        收藏</a>
@*    <a href="@Url.Action("Help", "Home")" class="last">常见问题</a>*@
}
<script type="text/javascript">
    function addfavor(url, title) {

        var ua = navigator.userAgent.toLowerCase();
        if (ua.indexOf("msie 8") > -1) {
            external.AddToFavoritesBar(url, title, 'butao');  //IE8
        } else {
            try {
                window.external.addFavorite(url, title);
            } catch (e) {
                try {
                    window.sidebar.addPanel(title, url, "");  //firefox
                } catch (e) {
                    alert("加入收藏失败，请使用Ctrl+D进行添加");
                }
            }
        }

        return false;
    }
</script>
